<script setup>
const props = defineProps(["orderInfo"]);

console.log(props);
</script>

<template>
  <div class="card">
    <div class="card_title">
      <div class="name">{{ props.orderInfo.shopName }}</div>
      <div class="state">已下单</div>
    </div>
    <div class="card_content">
      <div
        class="img_list"
        v-for="item in props.orderInfo.shopCartList"
        :key="item.id"
      >
        <div class="img">
          <img
            :src="`http://www.dell-lee.com/imgs/vue3/${item.imgName}.png`"
            alt=""
          />
        </div>
      </div>
      <div class="count">
        <div class="price">￥{{ props.orderInfo.total }}</div>
        <div class="total_number">共{{ props.orderInfo.number }}件</div>
      </div>
    </div>
  </div>
</template>

<style lang="scss" scoped>
@import "@/style/viriables.scss";
@import "@/style/mixins.scss";

.card {
  margin: 0.18rem;
  padding: 0.18rem;
  background-color: $bgColor;
  border-radius: 0.04rem;

  &_title {
    display: flex;
    justify-content: space-between;
    font-size: 0.16rem;
    .name {
      color: $content-fontcolor;
    }
    .state {
      color: $light-fontColor;
    }
  }

  &_content {
    display: flex;
    margin-top: 0.18rem;
    .img_list {
      flex: 1;
      display: flex;
      .img {
        margin-right: 0.08rem;
        img {
          width: 0.4rem;
          height: 0.4rem;
          display: block;
        }
      }
    }
    .count {
      width: 0.6rem;
      text-align: right;
      .price {
        line-height: 0.2rem;
        color: $hightlight-fontColor;
      }
      .total_number {
        line-height: 0.14rem;
        margin-top: 0.06rem;
        font-size: 0.12rem;
      }
    }
  }
}
</style>